/*
 * Copyright (c) 2019 Hitevision
 */

package tw.com.hitevision.whiteboard.android.util;

import android.app.ActivityManager;
import android.content.Context;

import java.util.ArrayList;
import java.util.List;

public class ActivityUtils {
    public static final String ACTIVITY_BRIGHTNESS_DIALOG = "com.android.systemui/com.android.systemui.settings.BrightnessDialog";
    public static final String ACTIVITY_LAUNCHER = "com.hht.launcher/com.hht.launcher.activity.LauncherViewActivity";
    public static final String ACTIVITY_PC = "hht.uc.source/hht.uc.source.FullScreenActivity";
    public static final String ACTIVITY_PC_2 = "com.hht.source/com.hht.source.activity.InputSourceActivity";
    public static final String ACTIVITY_PC_SETTINGS = "com.example.sourcesetting/com.example.sourcesetting.SourceSetting";
    public static final String ACTIVITY_PC_HISI = "com.hisilicon.tvui/com.hisilicon.tvui.play.MainActivity";
    public static final String ACTIVITY_WHITEBOARD = "tw.com.newline.whiteboard/tw.com.newline.whiteboard.android.MainActivity";
    public static final String ACTIVITY_VISUALIZER = "com.newline.visualizer/com.newline.visualizer.MainActivity";

    /**
     * Returns a list of running tasks.
     */
    public static List<ActivityManager.RunningTaskInfo> getRunningTasks(Context context,  int numOfTasks) {
        final ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
        if (am != null) {
            return am.getRunningTasks(numOfTasks);
        } else {
            return new ArrayList<>();
        }
    }
}
